
package nc.impl.hrpbm.pj.budgetvaluation;

import nc.bs.pfxx.plugin.AbstractPfxxPlugin;
import nc.vo.pub.BusinessException;
import nc.bs.pfxx.ISwapContext;
import nc.vo.pfxx.auxiliary.AggxsysregisterVO;
import nc.vo.pfxx.util.PfxxPluginUtils;
import nc.bs.framework.common.NCLocator;
import nc.vo.hrpbm.pj.AggBudgetvaluationVO;
import nc.itf.hrpbm.pj.budgetvaluation.IBudgetvaluationhVOService;

public class BudgetvaluationhVOPfxxPlugin extends AbstractPfxxPlugin {
	
	@Override
	protected Object processBill(Object vo, ISwapContext swapContext, AggxsysregisterVO aggxsysvo)
			throws BusinessException {
		AggBudgetvaluationVO entityVO = (AggBudgetvaluationVO)vo;
		String vopk = PfxxPluginUtils.queryBillPKBeforeSaveOrUpdate(swapContext.getBilltype(), swapContext.getDocID());
		entityVO.getParentVO().setPrimaryKey(vopk);
		AggBudgetvaluationVO[] saveVO = getService().saveAggBudgetvaluationVO(entityVO);
		return saveVO;
	}
	
	private IBudgetvaluationhVOService getService() {
		return NCLocator.getInstance().lookup(IBudgetvaluationhVOService.class);
	}
}